home *** CD-ROM | disk | FTP | other *** search
- unit HitchHiker;
- interface
- uses
- InvokeRegistry;
-
- type
- IHitchHiker = interface(IInvokable)
- ['{06723E05-662D-11D5-81CE-00104BF89DAD}']
- function TheAnswer: Integer; stdcall;
- function TheQuestion: String; stdcall;
- end;
-
- THitchHiker = class(TInvokableClass, IHitchHiker)
- public
- function TheAnswer: Integer; stdcall;
- function TheQuestion: String; stdcall;
- end;
-
- implementation
-
- { THitchHiker }
-
- function THitchHiker.TheAnswer: Integer;
- begin
- Result := 42
- end;
-
- function THitchHiker.TheQuestion: String;
- begin
- Result := 'What do you get when you multiply six by nine?'
- end;
-
- initialization
- InvRegistry.RegisterInterface(TypeInfo(IHitchHiker));
- InvRegistry.RegisterInvokableClass(THitchHiker)
- end.
-